using System;
using System.Data;
using System.Data.SqlClient;

namespace time
{
    public class work_sql5
    {
        public static void Main()
        {
            string connectionString = @"server=PEK7-DEV-02.vancloa.cn;database=MY_SCM;uid=testdbuser;pwd=devuser221;";
            SqlConnection con = new SqlConnection(connectionString);
            SqlCommand com = new SqlCommand();

            string sql = "select distinct top 10 * from Clothes";

            com.Connection = con;
            com.CommandText = sql;
            SqlDataAdapter ada = new SqlDataAdapter();
            ada.SelectCommand = com;
            DataSet ds = new DataSet();
            ada.Fill(ds);
            com.Dispose();
            DataTable dt = new DataTable();
            dt = ds.Tables[0];

            foreach (DataRow row in dt.Rows)
            {
                foreach (DataColumn column in dt.Columns)
                {
                    Console.Write(row[column] + " ");
                }
            }
            Console.Read();
        }
    }
}